﻿<!DOCTYPE html>
<html ng-app="singleApp">

<head>
    <meta charset="UTF-8">
    <title>欢迎页面-X-admin2.0</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8" />

    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="<?php echo base_url('public/thirdParty/aodong-front/css/font.css'); ?>" />
    <link rel="stylesheet" href="<?php echo base_url('public/thirdParty/aodong-front/css/xadmin.css'); ?>" />
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script src="<?php echo base_url('public/thirdParty/aodong-front/lib/layui/layui.js'); ?>" charset="utf-8"></script>
    <script type="text/javascript" src="<?php echo base_url('public/thirdParty/aodong-front/js/xadmin.js'); ?>"></script>

    <script src="<?php echo base_url() .'public/' ?>/thirdParty/layer/layer.js"></script>

    <script src="<?php echo base_url('public/thirdParty/angular-1.6.4/angular.min.js'); ?>"></script>
    <script type="text/javascript">
    	var singleApp = angular.module('singleApp', []);
        window.singleConfig = {};
        window.singleConfig.rootUrl = "<?php echo base_url(); ?>";
    </script>
    <script src="<?php echo base_url('public/app/service.js'); ?>"></script>
</head>

<body class="layui-anim layui-anim-up">
    <div class="x-nav">
        <span class="layui-breadcrumb">
            <a href="javascript:void(0);">用户管理</a>
            <a href="javascript:void(0);">
                <cite>用户列表</cite>
            </a>
        </span>
        <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
            <i class="layui-icon" style="line-height:30px">ဂ</i>
        </a>
    </div>
    <div class="x-body" ng-controller="usersCtrl">
        <div class="layui-row">
            <form class="layui-form layui-col-md12 x-so">
                <span>用户名：</span>
                <input type="text" name="username" placeholder="请输入用户名" autocomplete="off" class="layui-input" ng-model="Page.user_name"/>

                <span style="margin-left:20px;">手机号：</span>
                <input type="text" name="phone" placeholder="请输入手机号" autocomplete="off" class="layui-input" ng-model="Page.phone"/>


                <button class="layui-btn" lay-submit="" lay-filter="sreach" ng-click="search();"><i class="layui-icon">&#xe615;</i></button>
            </form>
        </div>
        <xblock style="height:40px;">
            <button class="layui-btn layui-btn-danger" ng-click="export_users();"><i class="layui-icon"></i>导出 Excel</button>
            <span class="x-right" style="line-height:40px">共有数据：<span ng-bind="Page.TotalRecords"></span> 条</span>
        </xblock>
        <table class="layui-table">
            <thead>
                <tr>
                    <th>id</th>
                    <th>用户名</th>
                    <th>手机号</th>
                    <th>创建时间</th>
                    <th>状态</th>
                    <th>操作</th>
                </tr>
            </thead>

            <tbody>
                <tr ng-repeat="item in list" ng-if="item.role != 'admin'">
                    <td ng-bind="item.id"></td>
                    <td ng-bind="item.user_name"></td>
                    <td ng-bind="item.phone"></td>
                    <td ng-bind="item.add_time"></td>
                    <td class="td-status">
                        <span ng-if="item.status != -1" class="layui-btn layui-btn-normal layui-btn-mini">正常</span>
                        <span ng-if="item.status == -1" class="layui-btn layui-btn-danger layui-btn-mini">禁用</span>
                    </td>
                    <td class="td-manage">
                        <a ng-click="deleteUser(item);" title="删除用户" href="javascript:;">
                            <i class="layui-icon"></i>
                        </a>
                    </td>
                </tr>  
            </tbody>
        </table>
        <div class="page" ng-if="list.length > 0">
            <div>
                <a ng-if="Page.pageindex != 1" class="prev" href="javascript:void(0);" ng-click="GoToPage(Page.pageindex - 1);">&lt;&lt;</a>
                <span ng-repeat="pn in Page.PageRange" class="{{Page.pageindex == pn ? 'current':'num'}}" ng-click="GoToPage(pn);" ng-bind="pn" style="cursor:pointer;"></span>
                <a ng-if="Page.pageindex != Page.TotalPages" class="next" href="javascript:void(0);" ng-click="GoToPage(Page.pageindex + 1);">&gt;&gt;</a>
            </div>
        </div>

        <div id="divQRCodePopup" style="display:none;padding: 20px;">
            <div id="divQRCode" data-url="<?php echo base_url() .'user/affi?token=' ?>" style="text-align:center;"></div>
        </div>
    </div>
    <script src="<?php echo base_url() .'public/' ?>/js/jquery.qrcode.min.js" type="text/javascript"></script>
    <script src="<?=base_url()?>public/app/admin/usersCtrl.js?v=30"></script>
</body>
</html>